<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateElRechargeRuleTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('el_recharge_rule', function (Blueprint $table) {

            $table->increments('id');//

            $table->string('type')->default('gift_recharge');

            $table->string('name');                 //储值规则名称

            $table->string('title')->nullable();   //前端显示副标题

            $table->decimal('payment_amount',15,2)->nullable();  //实付金额

            $table->decimal('amount',15,2)->nullable();   //到账金额

            $table->tinyInteger('status')->default(0); 	 //状态：1 有效 ，0 失效

            $table->tinyInteger('open_point')->default(0); 	//赠送积分状态：1 是 ，0 否

            $table->integer('point')->default(0);        //赠送积分

            $table->tinyInteger('open_coupon')->default(0); 	//赠送优惠券状态：1 是 ，0 否

            $table->integer('sort')->default(0);        //排序

            $table->nullableTimestamps();

            $table->softDeletes();

            $table->engine = 'InnoDB';

        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        //
        Schema::drop('el_recharge_rule');
    }
}
